syntax = "proto3";

package thunderpb;
option go_package = "github.com/samsarahq/thunder/thunderpb";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

enum FieldKind {
  Unknown = 0;
  Null = 1;
  Bool = 2;
  Int = 3;
  Uint = 4;
  String = 5;
  Bytes = 6;
  Float64 = 7;
  Time = 8;
}

message Field {
  FieldKind kind = 1;
  oneof value {
    bool bool = 2;
    sint64 int = 3;
    uint64 uint = 4;
    string string = 5;
    bytes bytes = 6;
    double float64 = 7;
    google.protobuf.Timestamp time = 8 [ (gogoproto.stdtime) = true ];  // gogoproto.nullable = false is not compatible with oneof.
  }
}

message SQLFilter {
  string table = 1;

  // Map of column name to field value.
  map<string, Field> fields = 2;
}

message ExpirationTime {
  google.protobuf.Timestamp time = 1 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
}
